package com.BCM.service.impl;


import com.BCM.dao.CClassDao;

import com.BCM.po.CClass;

import com.BCM.service.CClassService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author tanghao
 */
@Service
public class CClassImpl implements CClassService {
    @Autowired
    private CClassDao cclassDao;
    @Override
    public List<CClass> findAllCClass() {



        return this.cclassDao.findAllCClass();
    }

    @Override
    public int deleteCClass(int classId) {
        int num=this.cclassDao.deleteCClass(classId);
        return num;
    }

    @Override
    public CClass findCClassByclassId(int classId) {
        return this.cclassDao.findCClassByclassId(classId);
    }

    @Override
    public int updateCClass(CClass cclass) {
        return this.cclassDao.updateCClass(cclass);
    }

    @Override
    public void save(CClass cclass) {
        cclassDao.save(cclass);
    }

    @Override
    public List<CClass> findCClassByTeacherName(String TeacherName) {
        List<CClass> cclasses=this.cclassDao.findCClassByTeacherName(TeacherName);
        for (CClass cclass:cclasses){
            System.out.println("service"+cclass);
        }
        return cclasses;
    }

}
